package com.example.datapersistence;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import androidx.appcompat.app.AppCompatActivity;


public class MainActivity extends AppCompatActivity implements View.OnClickListener {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        Button to_sharedpreferences_bt = findViewById(R.id.to_sharedpreferences_bt);
        Button to_sqliteact_bt = findViewById(R.id.to_sqliteact_bt);
        to_sharedpreferences_bt.setOnClickListener(this);
        to_sqliteact_bt.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.to_sharedpreferences_bt:
                Intent intent = new Intent(this, SharedPreferenceActivity.class);
                startActivity(intent);
                break;
            case R.id.to_sqliteact_bt:
                Intent intent2 = new Intent(this, SqliteActivity.class);
                startActivity(intent2);
                break;

        }
    }
}